package com.zkw.gro.cloure.demo

/**
 * Created by Administrator on 2016/4/9 0009.
 */
class MultimethodClosureMain {
    int mysteryMethod(String value){
        return value.length()
    }

    int mysteryMethod(List list){
        return list.size()
    }

    int mysteryMethod(int x,int y){
        return x+y
    }

    public static void main(String[] args) {
        MultimethodClosureMain instance = new MultimethodClosureMain()
        Closure multi = instance.&mysteryMethod
        assert 10 == multi('string arg')
        assert 3 == multi(['list','of','value'])
        assert 14 == multi(6,8)
    }
}
